$.getJSON(menus_api, function(data) {

    var html = '';
    $.each(data, function(key, value) {
        html += '<li class="am-parent"><a href="##" class="">' + value.name + '</a>';

        if(value.children != '') {
            html += '<ul class="am-menu-sub am-collapse  am-avg-sm-2 ">';
            $.each(value.chidlren, function(k, v) {
                html += '<li class=""><a href="##" class="">' + v.name + '</a></li>';
            })

            html += '</ul>';
        }
        html += '</li>';
    })

    $(".x-menus").html(html);
});
